/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.spreedairy.portal.service.persistence;

import com.liferay.portal.service.persistence.BasePersistence;

import com.spreedairy.portal.model.CustomField;

/**
 * The persistence interface for the custom field service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author SpreeDairy
 * @see CustomFieldPersistenceImpl
 * @see CustomFieldUtil
 * @generated
 */
public interface CustomFieldPersistence extends BasePersistence<CustomField> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link CustomFieldUtil} to access the custom field persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the custom field in the entity cache if it is enabled.
	*
	* @param customField the custom field
	*/
	public void cacheResult(com.spreedairy.portal.model.CustomField customField);

	/**
	* Caches the custom fields in the entity cache if it is enabled.
	*
	* @param customFields the custom fields
	*/
	public void cacheResult(
		java.util.List<com.spreedairy.portal.model.CustomField> customFields);

	/**
	* Creates a new custom field with the primary key. Does not add the custom field to the database.
	*
	* @param recId the primary key for the new custom field
	* @return the new custom field
	*/
	public com.spreedairy.portal.model.CustomField create(long recId);

	/**
	* Removes the custom field with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param recId the primary key of the custom field
	* @return the custom field that was removed
	* @throws com.spreedairy.portal.NoSuchCustomFieldException if a custom field with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField remove(long recId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldException;

	public com.spreedairy.portal.model.CustomField updateImpl(
		com.spreedairy.portal.model.CustomField customField, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the custom field with the primary key or throws a {@link com.spreedairy.portal.NoSuchCustomFieldException} if it could not be found.
	*
	* @param recId the primary key of the custom field
	* @return the custom field
	* @throws com.spreedairy.portal.NoSuchCustomFieldException if a custom field with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField findByPrimaryKey(long recId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldException;

	/**
	* Returns the custom field with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param recId the primary key of the custom field
	* @return the custom field, or <code>null</code> if a custom field with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField fetchByPrimaryKey(long recId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the custom fields where categoryId = &#63;.
	*
	* @param categoryId the category ID
	* @return the matching custom fields
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomField> findByCategoryId(
		long categoryId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the custom fields where categoryId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param categoryId the category ID
	* @param start the lower bound of the range of custom fields
	* @param end the upper bound of the range of custom fields (not inclusive)
	* @return the range of matching custom fields
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomField> findByCategoryId(
		long categoryId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the custom fields where categoryId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param categoryId the category ID
	* @param start the lower bound of the range of custom fields
	* @param end the upper bound of the range of custom fields (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching custom fields
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomField> findByCategoryId(
		long categoryId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first custom field in the ordered set where categoryId = &#63;.
	*
	* @param categoryId the category ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching custom field
	* @throws com.spreedairy.portal.NoSuchCustomFieldException if a matching custom field could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField findByCategoryId_First(
		long categoryId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldException;

	/**
	* Returns the first custom field in the ordered set where categoryId = &#63;.
	*
	* @param categoryId the category ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching custom field, or <code>null</code> if a matching custom field could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField fetchByCategoryId_First(
		long categoryId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last custom field in the ordered set where categoryId = &#63;.
	*
	* @param categoryId the category ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching custom field
	* @throws com.spreedairy.portal.NoSuchCustomFieldException if a matching custom field could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField findByCategoryId_Last(
		long categoryId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldException;

	/**
	* Returns the last custom field in the ordered set where categoryId = &#63;.
	*
	* @param categoryId the category ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching custom field, or <code>null</code> if a matching custom field could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField fetchByCategoryId_Last(
		long categoryId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the custom fields before and after the current custom field in the ordered set where categoryId = &#63;.
	*
	* @param recId the primary key of the current custom field
	* @param categoryId the category ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next custom field
	* @throws com.spreedairy.portal.NoSuchCustomFieldException if a custom field with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField[] findByCategoryId_PrevAndNext(
		long recId, long categoryId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldException;

	/**
	* Returns the custom field where categoryId = &#63; and fieldOrder = &#63; or throws a {@link com.spreedairy.portal.NoSuchCustomFieldException} if it could not be found.
	*
	* @param categoryId the category ID
	* @param fieldOrder the field order
	* @return the matching custom field
	* @throws com.spreedairy.portal.NoSuchCustomFieldException if a matching custom field could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField findByCategoryIdFieldOrder(
		long categoryId, int fieldOrder)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldException;

	/**
	* Returns the custom field where categoryId = &#63; and fieldOrder = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param categoryId the category ID
	* @param fieldOrder the field order
	* @return the matching custom field, or <code>null</code> if a matching custom field could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField fetchByCategoryIdFieldOrder(
		long categoryId, int fieldOrder)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the custom field where categoryId = &#63; and fieldOrder = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param categoryId the category ID
	* @param fieldOrder the field order
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching custom field, or <code>null</code> if a matching custom field could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField fetchByCategoryIdFieldOrder(
		long categoryId, int fieldOrder, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the custom fields.
	*
	* @return the custom fields
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomField> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the custom fields.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of custom fields
	* @param end the upper bound of the range of custom fields (not inclusive)
	* @return the range of custom fields
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomField> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the custom fields.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of custom fields
	* @param end the upper bound of the range of custom fields (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of custom fields
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomField> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the custom fields where categoryId = &#63; from the database.
	*
	* @param categoryId the category ID
	* @throws SystemException if a system exception occurred
	*/
	public void removeByCategoryId(long categoryId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes the custom field where categoryId = &#63; and fieldOrder = &#63; from the database.
	*
	* @param categoryId the category ID
	* @param fieldOrder the field order
	* @return the custom field that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomField removeByCategoryIdFieldOrder(
		long categoryId, int fieldOrder)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldException;

	/**
	* Removes all the custom fields from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of custom fields where categoryId = &#63;.
	*
	* @param categoryId the category ID
	* @return the number of matching custom fields
	* @throws SystemException if a system exception occurred
	*/
	public int countByCategoryId(long categoryId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of custom fields where categoryId = &#63; and fieldOrder = &#63;.
	*
	* @param categoryId the category ID
	* @param fieldOrder the field order
	* @return the number of matching custom fields
	* @throws SystemException if a system exception occurred
	*/
	public int countByCategoryIdFieldOrder(long categoryId, int fieldOrder)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of custom fields.
	*
	* @return the number of custom fields
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}